<%@ include file="/WEB-INF/views/include.jsp"%>
<div id="modal-delete-contenttype" class="modal hide fade">
		<div class="modal-header">
			<a href="#" class="close">&times;</a>
			<h3>Delete Content Type</h3>
		</div>
		<div class="modal-body">
		</div>
		<div class="modal-footer">
			<a href="#" onclick="closeModel('#modal-delete-contenttype')" class="btn danger">Close</a>
			<a href="#" onclick="deleteContentType()" class="btn success">submit</a>
		</div>
</div>

<script language="Javascript">

	function setInfoForDeleteContentType(url, nameContentType, idContentType){
		//alert("active form");
		jQuery("#modal-delete-contenttype").modal({
			show: true 
		})
		info = '<fmt:message key="contenttype.delete"/> : ' + nameContentType + '</p>' + 
			"<input type='hidden' id='urlDelete' value='" + url + "'/>" +
			"<input type='hidden' id='idContentType' value='" + idContentType + "'/>" ;
			jQuery('#modal-delete-contenttype .modal-body').html(info);
	}

	function deleteContentType() {
		urlDelete = jQuery('#modal-delete-contenttype input#urlDelete').val();
		idContentType = jQuery('#modal-delete-contenttype input#idContentType').val(); 
		jQuery('#modal-delete-contenttype').modal('hide');
		jQuery.ajax({
			  url: urlDelete,
			  context: document.body,
			  success: function(data){
				  if(data == "200"){
					 idContentSelect = "#home tbody ." + idContentType;
					 jQuery(idContentSelect).remove();
				  }else{
						alert("cannot delete this content");
					}
			  }
			});
	}

	
</script> 